package com.eastfair.venueservice.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperService;
import com.eastfair.venueservice.dto.ServiceProviderAuditDTO;
import com.eastfair.venueservice.dto.ServiceProviderDTO;
import com.eastfair.venueservice.entity.ServiceProvider;
import com.eastfair.venueservice.entity.ServiceProviderAudit;
import com.eastfair.venueservice.vo.ServiceProviderAuditVO;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 服务商审核流程表
 * </p>
 *
 * @author gj
 * @date 2022 -07-13
 */
public interface ServiceProviderAuditService extends SuperService<ServiceProviderAudit> {

    /**
     * 查询审核VO列表.
     *
     * @param pageParams the page params
     * @return the page
     */
    IPage<ServiceProviderAuditVO> listServiceProviderAuditVOs(PageParams<ServiceProviderAuditDTO> pageParams);

    /**
     * 查询审核列表.
     *
     * @param pageParams the page params
     * @return the page
     */
    IPage<ServiceProviderAudit> listServiceProviderAudits(PageParams<ServiceProviderAuditDTO> pageParams);

    /**
     * 查询服务商审核列表.
     *
     * @param param the param
     * @return the list
     */
    List<ServiceProviderAudit> listServiceProviderAudits(ServiceProviderAuditDTO param);

    /**
     * 服务商ID查询审核列表.
     *
     * @param serviceProviderId the service provider id
     * @return the list
     */
    List<ServiceProviderAudit> listByServiceProviderId(Long serviceProviderId);

    /**
     * ID查询审核详情.
     *
     * @param id the id
     * @return the service provider audit vo
     */
    ServiceProviderAuditVO getServiceProviderAuditVOById(Long id);

    /**
     * 服务商ID查询未结束的审核.
     *
     * @param serviceProviderId the service provider id
     * @return the reporting audit by service provider id
     */
    ServiceProviderAudit getAuditingByServiceProviderId(Long serviceProviderId);

    /**
     * 服务商id获取最近的审核记录.
     *
     * @param serviceProviderId the service provider id
     * @return the latest audit by service provider id
     */
    ServiceProviderAudit getLatestAuditByServiceProviderId(Long serviceProviderId);

    /**
     * 服务商ID查询初审类型的审核.
     *
     * @param serviceProviderId the service provider id
     * @return the first audit by service provider id
     */
    ServiceProviderAudit getFirstAuditByServiceProviderId(Long serviceProviderId);

    /**
     * 保存服务商审核记录.
     *
     * @param auditDTO the audit dto
     * @return the boolean
     */
    boolean saveServiceProviderAudit(ServiceProviderAuditDTO auditDTO);

    /**
     * 更新服务商审核记录.
     *
     * @param auditDTO the audit dto
     * @return the boolean
     */
    boolean updateServiceProviderAudit(ServiceProviderAuditDTO auditDTO);

    /**
     * 更新服务商审核结果.
     *
     * @param auditDTO the audit dto
     * @return the boolean
     */
    boolean updateAuditResult(ServiceProviderAuditDTO auditDTO);

    /**
     * 更新审核拒绝的审核记录，将审核结果重置.
     *
     * @param serviceProviderDTO the audit dto
     * @return the boolean
     */
    boolean updateNotApprovedAudit(ServiceProviderDTO serviceProviderDTO);

    /**
     * 复制服务商审核记录.
     *
     * @param sourceServiceProviderId   原服务商ID
     * @param targetServiceProviderId   目标服务商ID
     * @param targetServiceProviderType the target service provider type
     * @return the boolean
     */
    boolean copyBatchNewTypeServiceProviderAudit(Long sourceServiceProviderId, Long targetServiceProviderId, String targetServiceProviderType);

    /**
     * 发送服务商注册站内信.
     *
     * @param serviceProviderAudit the service provider
     * @return the boolean
     */
    boolean sendRegisterInnerMsg(ServiceProviderAudit serviceProviderAudit);

    /**
     * 异步发送服务商注册站内信.
     *
     * @param serviceProviderAudit the service provider audit
     */
    void asyncSendRegisterInnerMsg(ServiceProviderAudit serviceProviderAudit);
}
